/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */

import { BasicFileSnapshot } from '../core/filesystem-snapshot.js';

/**
 * Filesystem snapshot comparator
 *
 * @since 2022/9/1
 */
export interface FilesystemSnapshotComparator {
  compare(oldSnapshot: BasicFileSnapshot, newSnapshot: BasicFileSnapshot): boolean;
}

export class DefaultFileSystemSnapshotComparator implements FilesystemSnapshotComparator {
  compare(oldSnapshot: BasicFileSnapshot, newSnapshot: BasicFileSnapshot): boolean {
    return oldSnapshot.equals(newSnapshot);
  }
}
